package RenameBean;

import MethodAnnotations.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author quan
 * @Description 对Bean进行重命名
 * @Date 2023/7/13 9:04
 */

@Configuration
public class a01_RenameMethod {
    //可以起一个名称
//    @Bean("ccc")
//    public AddParams.User user(){
//        AddParams.User user = new AddParams.User();
//        user.setName("小花花");
//        user.setAge(1);
//        return user;
//    }
    //起多个名称
    @Bean(name= {"aaa","bbb"})
    public User user2(){
        User user = new User();
        user.setName("小星星");
        user.setAge(1);
        return user;
    }
}
